package com.kyin.satoken.exception;

import com.kyin.satoken.common.GlobalConst;
import lombok.Data;

/**
 * @author kyin
 * @date 2025-06-21 16:11
 */
@Data
public class GlobalException extends RuntimeException {

    private int code = GlobalConst.Response.SERVER_ERROR;

    public GlobalException(String msg) {
        super(msg);
    }

    public GlobalException(String msg, Throwable e) {
        super(msg, e);
    }

    public GlobalException(String msg, int code) {
        super(msg);
        this.setCode(code);
    }

    public GlobalException(String msg, int code, Throwable e) {
        super(msg, e);
        this.setCode(code);
    }
}
